package com.example.hyxydoctor.mine;

import android.widget.Toast;


import com.example.hyxydoctor.Bean.HttpData;
import com.example.hyxydoctor.Bean.UserBean;
import com.example.hyxydoctor.base.BasePresenterOkgo;
import com.example.hyxydoctor.base.HttpConfig;
import com.example.hyxydoctor.http.JsonCallBack;
import com.lzy.okgo.model.Response;

public class LoginPresenter extends BasePresenterOkgo<LoginActivity> {

    public void getLogin(String phone,String pwd) {
        httpService.getLogin(phone,pwd)
                .execute(new JsonCallBack<HttpData<UserBean>>(false) {
                    @Override
                    public void onSuccess(Response<HttpData<UserBean>> response) {
                        HttpData<UserBean> httpData = response.body();
                        Toast.makeText(getContext(),httpData.getTimestamp()+""+httpData.getDescription(),Toast.LENGTH_LONG).show();
                        if (httpData.getCode() == HttpConfig.OK) {

                        }
                    }

                });
    }

}
